package tn.orange.canreminder.service;

import java.util.List;

import org.apache.http.NameValuePair;

import tn.orange.canreminder.conf.Config;
import tn.orange.canreminder.model.JSONPlacesCategory;
import tn.orange.canreminder.model.PlacesCategory;
import tn.orange.canreminder.parse.GenericJsonParser;

public class PlacesCategoriesServiceImp implements PlacesCategoriesService {

	@Override
	public List<PlacesCategory> getAllCategories(
			List<NameValuePair> nameValuePairs) throws Exception {

		GenericJsonParser parser = new GenericJsonParser();
		// TODO Auto-generated method stub

		parser.setOutput(JSONPlacesCategory.class);
		parser.setUrl(Config.categories);
		parser.setNameValuePairs(nameValuePairs);
		JSONPlacesCategory object = (JSONPlacesCategory) parser.parse();
		List<PlacesCategory> categories = object.getPlacescategories();
		return categories;

	}

}
